{% load i18n %}
{% load static %}
<html>
    <head>
        <title>{% block title %}{% endblock %} :: venueless</title>
        <link rel="stylesheet" href="{% static 'control/style.css' %}">
        <script src="{% static 'control/jquery-3.6.0.js' %}"></script>
        <script src="{% static 'js/jquery.formset.js' %}"></script>
    </head>
    <body>
        <header>
            {% if request.user.is_authenticated %}
                <a href="{% url 'control:auth.profile' %}">Profile</a> ·
                <a href="{% url 'control:logout' %}">Logout</a>
            {% else %}
                <a href="{% url 'control:login' %}">Login</a>
            {% endif %}
        </header>
        <div id="main-container">
            <nav>
                {% if request.user.is_authenticated and request.user.is_staff %}
                <a href="{% url "control:index" %}"{% if request.path == "/control/" %} class="active" {% endif %}>
                    {% trans "Dashboard" %}
                </a>
                <a href="{% url "control:world.list" %}"{% if request.path == "/control/worlds/" %} class="active"{% endif %}>
                    {% trans "Worlds" %}
                </a>
                <a href="{% url "control:bbbserver.list" %}"{% if request.path == "/control/bbbs/" %} class="active"{% endif %}>
                    {% trans "BBB servers" %}
                </a>
                <a href="{% url "control:bbbserver.moveroom" %}"{% if request.path == "/control/bbbs/moveroom/" %} class="active"{% endif %}>
                {% trans "Move BBB room" %}
                </a>
                <a href="{% url "control:turnserver.list" %}"{% if request.path == "/control/turns/" %} class="active"{% endif %}>
                   {% trans "TURN servers" %}
                </a>
                <a href="{% url "control:janusserver.list" %}"{% if request.path == "/control/janus/" %} class="active"{% endif %}>
                    {% trans "Janus servers" %}
                </a>
                <a href="{% url "control:streamingserver.list" %}"{% if request.path == "/control/streamingservers/" %} class="active"{% endif %}>
                    {% trans "Streaming servers" %}
                </a>
                <a href="{% url "control:streamkey" %}"{% if request.path == "/control/streamkey/" %} class="active"{% endif %}>
                    {% trans "Streamkey generator" %}
                </a>
                <a href="{% url "control:feedback.list" %}"{% if request.path == "/control/feedback/" %} class="active"{% endif %}>
                    {% trans "Feedback" %}
                </a>
                <a href="{% url "control:conftool.syncposters" %}"{% if request.path == "/control/conftool/syncposters/" %} class="active"{% endif %}>
                    {% trans "Conftool posters" %}
                </a>
                    {% if request.user.is_superuser %}
                    <a href="{% url "control:user.list" %}"{% if request.path == "/control/users/" %} class="active"{% endif %}>
                        {% trans "Users" %}
                    </a>
                    {% endif %}
                {% endif %}
            </nav>
            <main>

                {% if messages %}
                    <ul class="messages">
                        {% for message in messages %}
                        <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
                        {% endfor %}
                    </ul>
                {% endif %}

            {% block content %}

            {% endblock %}

            </main>
        </div>
    </body>
</html>
